fix(sandboxr): apply srt startup-race workaround to shell command#720
Merged
Conversation
`sandboxr shell` built its argv as backend.build_args() + the raw shell command, never calling backend.wrap_command() — unlike run/doctor, which both correctly wrap the command. For the srt backend this meant `shell` had no protection against the known proxy-startup race (srt's internal proxy bridges aren't ready for ~150-200ms after launch), unlike `run` and `doctor`. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sandboxr shellbuilt its argv asbackend.build_args() + shell_cmd, never callingbackend.wrap_command()— unlikerun/doctor, which both correctly do[*build_args(...), *wrap_command(cmd)].srtbackend this meantshellhad no protection against the known startup-race bug (srt's internal proxy bridges aren't ready for ~150-200ms after launch — the first request can fail instantly without a grace sleep).runanddoctoralready work around this;shelldidn't.run.py's pattern:*backend.wrap_command([shell_cmd]).Test plan
test_shell_srt_backend_show_command_applies_startup_race_workaround, confirmed it fails against the pre-fix code (assertedsleep 0.2; exec ...is embedded in the wrapped command), then confirmed it passes after the fix.Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com